package net.ubinow.mflex.data;

import java.io.DataInputStream;
import java.io.DataOutputStream;

import net.ubinow.mflex.exceptions.SerializationException;


/**
 *
 * @author Josh
 */
public interface Serializable
{
    /**
     * Get the name of the class to be used for serialization/deserialization
     * of complex/nested objects.
     *
     * @return class name
     */
    String getSerializableClassName();

    /**
     * Write object status to stream.
     *
     * @param out output stream
     * @throws SerializationException on errors
     */
    void serialize( DataOutputStream out )
        throws SerializationException;

    /**
     * Read object status from stream.
     *
     * @param in input stream
     * @throws SerializationException on errors
     */
    void deserialize( DataInputStream in )
            throws SerializationException;
}
